import Vue from 'vue'
import VueRouter from 'vue-router'
import BookManage from '../views/BookManage'
import AddBook from '../views/AddBook'
import UpdateBook from '../views/UpdateBook'

import Index from '../views/Index'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '图书管理',
    component: Index,
    redirect: 'BookManage',
    show1: true,
    children: [
      {
        path: '/BookManage',
        name: '查询',
        component: BookManage
      },
      {
        path: '/AddBook',
        name: '添加',
        component: AddBook
      }
    ]
  },
  {
    path: '/UpdateBook',
    show1: false,
    component: UpdateBook
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
